feat(ci): auto-create github releases and add workflow permissions#3009
Merged
waleedlatif1 merged 1 commit intostagingfrom Jan 26, 2026
Merged
feat(ci): auto-create github releases and add workflow permissions#3009waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile OverviewGreptile SummaryThis PR automates GitHub release creation when version commits (e.g., Key changes:
Implementation details:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Git as Git (main branch)
participant CI as CI Workflow
participant Build as Build Jobs
participant Release as create-release Job
participant GitHub as GitHub API
Dev->>Git: Push version commit (e.g., "v0.5.35: new feature")
Git->>CI: Trigger CI workflow
CI->>CI: detect-version job extracts version from commit
CI->>Build: test-build runs tests
Build->>Build: build-amd64 creates AMD64 images
Build->>Build: build-ghcr-arm64 creates ARM64 images
Build->>Build: create-ghcr-manifests creates multi-arch manifests
Build->>Release: Trigger after manifests complete
Release->>Release: Checkout code with full history
Release->>Release: Install dependencies (bun install)
Release->>GitHub: Check if release already exists (getReleaseByTag)
alt Release already exists
GitHub->>Release: 200 OK (release exists)
Release->>Release: Skip creation (idempotent)
else Release doesn't exist
GitHub->>Release: 404 Not Found
Release->>Release: Generate release notes from commits
Release->>GitHub: Create release (createRelease)
GitHub->>Release: Release created successfully
end
|
Contributor
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 376:385
Comment:
If a release already exists for this version, the GitHub API will return a 422 error and fail the workflow. Check if release exists first or handle the error gracefully
```suggestion
await octokit.rest.repos.createRelease({
owner: REPO_OWNER,
repo: REPO_NAME,
tag_name: targetVersion,
name: targetVersion,
body: releaseBody,
draft: false,
prerelease: false,
target_commitish: versionCommit.hash,
}).catch((error) => {
if (error.status === 422) {
console.log(`ℹ️ Release ${targetVersion} already exists, skipping creation`)
return
}
throw error
})
```
How can I resolve this? If you propose a fix, please make it concise. |
Collaborator
Author
|
@greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bun releasestep neededType of Change
Testing
Tested by reviewing workflow logic
Checklist